<!DOCTYPE html>

<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->

<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->

<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->

<!-- BEGIN HEAD -->

<head>

	<meta charset="utf-8" />

	<title>Metronic | Login Options - Login Form 2</title>

	<meta content="width=device-width, initial-scale=1.0" name="viewport" />

	<meta content="" name="description" />

	<meta content="" name="author" />

	<!-- BEGIN GLOBAL MANDATORY STYLES -->

	<link href="__PUBLIC__/admin/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>

	<link href="__PUBLIC__/admin/css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css"/>

	<link href="__PUBLIC__/admin/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>

	<link href="__PUBLIC__/admin/css/style-metro.css" rel="stylesheet" type="text/css"/>

	<link href="__PUBLIC__/admin/css/style.css" rel="stylesheet" type="text/css"/>

	<link href="__PUBLIC__/admin/css/style-responsive.css" rel="stylesheet" type="text/css"/>

	<link href="__PUBLIC__/admin/css/default.css" rel="stylesheet" type="text/css" id="style_color"/>

	<link href="__PUBLIC__/admin/css/uniform.default.css" rel="stylesheet" type="text/css"/>

	<!-- END GLOBAL MANDATORY STYLES -->

	<!-- BEGIN PAGE LEVEL STYLES -->

	<link href="__PUBLIC__/admin/css/login-soft.css" rel="stylesheet" type="text/css"/>

	<!-- END PAGE LEVEL STYLES -->

	<link rel="shortcut icon" href="__PUBLIC__/admin/image/favicon.ico" />

</head>

<!-- END HEAD -->

<!-- BEGIN BODY -->

<body class="login">

	<!-- BEGIN LOGO -->

	<div class="logo">

		<img src="__PUBLIC__/admin/image/logo-big.png" alt="" /> 

	</div>

	<!-- END LOGO -->

	<!-- BEGIN LOGIN -->

	<div class="content">

		<!-- BEGIN LOGIN FORM -->

		<form class="form-vertical login-form" action="{:U('admin/user/login/dologin')}" method="post">

			<h3 class="form-title">后台登陆</h3>

			<div class="alert alert-error hide">

				<button class="close" data-dismiss="alert"></button>

				<span>请输入账号和密码!</span>

			</div>
			<div info="tishi" class="alert hide">

				<button class="close" data-dismiss="alert"></button>

				<span>请输入正确的账号和密码!</span>

			</div>

			<div class="control-group">

				<!--ie8, ie9 does not support html5 placeholder, so we just show field title for that-->

				<label class="control-label visible-ie8 visible-ie9">Username</label>

				<div class="controls">

					<div class="input-icon left">

						<i class="icon-user"></i>

						<input class="m-wrap placeholder-no-fix" value="{:cookie('user')['username']}" type="text" placeholder="Username" name="username"/>

					</div>

				</div>

			</div>

			<div class="control-group">

				<label class="control-label visible-ie8 visible-ie9">Password</label>

				<div class="controls">

					<div class="input-icon left">

						<i class="icon-lock"></i>

						<input class="m-wrap placeholder-no-fix" value="{:cookie('user')['password']}" type="password" placeholder="Password" name="password"/>

					</div>

				</div>

			</div>

			<div class="form-actions">

				<label class="checkbox">

				<input type="checkbox" name="remember" {:cookie('user')?'checked':''} value="1"/> 记住密码

				</label>

				<button id='tijiao' type="submit" class="btn blue pull-right">

				登陆 <i class="m-icon-swapright m-icon-white"></i>

				</button>            

			</div>

			<!-- <div class="forget-password">

				<h4>Forgot your password ?</h4>

				<p>

					no worries, click <a href="javascript:;" class="" id="forget-password">here</a>

					to reset your password.

				</p>

			</div> -->

			<div class="create-account">

				<p>

					忘记密码了 ?&nbsp; 

					<a href="javascript:alert('忘了密码你还想上?');" script="" class="">点击这里</a>

				</p>

			</div>

		</form>

		<!-- END LOGIN FORM -->        

	
	<!-- BEGIN COPYRIGHT -->

	<div class="copyright">

		2013 &copy; Commodity backstage.

	</div>

	<!-- END COPYRIGHT -->

	<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->

	<!-- BEGIN CORE PLUGINS -->

	<script src="__PUBLIC__/admin/js/jquery-1.10.1.min.js" type="text/javascript"></script>

	<script src="__PUBLIC__/admin/js/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>

	<!-- IMPORTANT! Load jquery-ui-1.10.1.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->

	<script src="__PUBLIC__/admin/js/jquery-ui-1.10.1.custom.min.js" type="text/javascript"></script>      

	<script src="__PUBLIC__/admin/js/bootstrap.min.js" type="text/javascript"></script>

	<!--[if lt IE 9]>

	<script src="__PUBLIC__/admin/js/excanvas.min.js"></script>

	<script src="__PUBLIC__/admin/js/respond.min.js"></script>  

	<![endif]-->   

	<script src="__PUBLIC__/admin/js/jquery.slimscroll.min.js" type="text/javascript"></script>

	<script src="__PUBLIC__/admin/js/jquery.blockui.min.js" type="text/javascript"></script>  

	<script src="__PUBLIC__/admin/js/jquery.cookie.min.js" type="text/javascript"></script>

	<script src="__PUBLIC__/admin/js/jquery.uniform.min.js" type="text/javascript" ></script>

	<!-- END CORE PLUGINS -->

	<!-- BEGIN PAGE LEVEL PLUGINS -->

	<script src="__PUBLIC__/admin/js/jquery.validate.min.js" type="text/javascript"></script>

	<script src="__PUBLIC__/admin/js/jquery.backstretch.min.js" type="text/javascript"></script>

	<!-- END PAGE LEVEL PLUGINS -->

	<!-- BEGIN PAGE LEVEL SCRIPTS -->

	<script src="__PUBLIC__/admin/js/app.js" type="text/javascript"></script>

	<script src="__PUBLIC__/admin/js/login-soft.js" type="text/javascript"></script>      

	<!-- END PAGE LEVEL SCRIPTS --> 

	<script>

		jQuery(document).ready(function() {     

		  App.init();

		  Login.init();

		});

	</script>
	<script type="text/javascript">
	$('#tijiao').click(function(){
		var username = $('input[name="username"]').val();
		var password = $('input[name="password"]').val();
		var remember = $('input[name="remember"]:checked').val();
		if(parseInt(remember)!=1){
			remember = 0;
		}
		// alert(remember);
		$.ajax({
			url:'{:U("admin/user/login/dologin")}',
			data:{'username':username,'password':password,'remember':remember},
			type:'post',
			success:function(mes){
				// alert('aaa');
				// console.log(mes);
				if(mes=='yes'){
					location.href="/admin/user/user/index";
				}else{
					if($('.alert-error').css('display')=='block'){
						$('div[info="tishi"]').hide();
					}
					if(username && password){
						$('.alert-error').hide();
						$('div[info="tishi"]').show();
					}
					return false;
				}
			}
		});
		// return false;
	});
	</script>

	<!-- END JAVASCRIPTS -->

</body>

<!-- END BODY -->

</html>